package com.black.cat.jvm.classfile.constantpool.impl;


import com.black.cat.jvm.classfile.ClassReader;
import com.black.cat.jvm.classfile.constantpool.BaseConstantInfo;
import com.black.cat.jvm.classfile.constantpool.ConstantInfo;
import com.black.cat.jvm.common.CommonValue;

/**
 * @Author blackcat
 * @create 2021/8/12 20:40
 * @version: 1.0
 * @description:整型字面量
 *
 * CONSTANT_Integer_info { u1 tag; u4 bytes; }
 */
public class ConstantInfoInteger extends BaseConstantInfo implements ConstantInfo {

    public ConstantInfoInteger(ClassReader reader) {
        value = reader.nextU4ToInt() + ""; // u4
    }

    @Override
    public int getTag() {
        return CommonValue.CONSTANT_POOL_TAG_INTEGER;
    }
}
